﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VS4CRM.Lib
{
    public class SynchronizationProgressEventArgs:EventArgs
    {
        internal int TotalNumberOfSteps ;
        private int _current =0 ;

        internal void Increment()
        {
            lock (this)
            {
                _current = _current + 1;
            }
        }

        internal void Reset()
        {
            lock (this)
            {
                _current = 0;
            }
        }

        public int Completed
        {
            get
            {
                if (TotalNumberOfSteps == 0) return 100;
                return (int)(((decimal)_current/TotalNumberOfSteps) * 100);
            }
        }
        public string Stage;
        public int TotalStages;
        public int CurrentStage;
        public string Text;
    }
}
